module.exports = (api, options, rootOptions) => {
  // 修改 `package.json` 里的字段
  api.extendPackage({
    scripts: {
      "dev": "vue-cli-service serve",
      "build": "vue-cli-service build",
      "preview": "node build/index.js --preview",
      "test:unit": "vue-cli-service test:unit",
      "lint": "vue-cli-service lint",
      "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/"
    },
    dependencies: {
      "axios": "^0.19.2",
      "babel-polyfill": "^6.26.0",
      "element-ui": "^2.15.3",
      "js-cookie": "^2.2.1",
      "js-md5": "^0.7.3",
      "lodash-es": "^4.17.15",
      "normalize.css": "^8.0.1",
      "nprogress": "^0.2.0",
      "screenfull": "^5.1.0",
      "vue": "^2.6.11",
      "vue-router": "^3.1.5",
      "vuex": "^3.1.2"
    },
    devDependencies: {
      "@babel/preset-env": "^7.14.7",
      "@commitlint/cli": "^7.2.0",
      "@commitlint/config-conventional": "^7.5.0",
      "@vue/cli-plugin-babel": "~4.5.0",
      "@vue/cli-plugin-eslint": "~4.5.0",
      "@vue/cli-plugin-unit-jest": "~4.5.0",
      "@vue/cli-service": "~4.5.0",
      "@vue/eslint-config-standard": "^5.1.2",
      "@vue/test-utils": "^1.0.3",
      "@ziyi2/vue-cli-plugin-ui-cz": "latest",
      "babel-eslint": "^10.1.0",
      "babel-plugin-component": "^1.1.1",
      "babel-plugin-dynamic-import-node": "2.3.3",
      "commitizen": "^3.0.5",
      "compression-webpack-plugin": "^5.0.1",
      "connect": "^3.7.0",
      "conventional-changelog": "^3.0.5",
      "core-js": "^3.15.2",
      "eslint": "^6.7.2",
      "eslint-plugin-import": "^2.20.2",
      "eslint-plugin-node": "^11.1.0",
      "eslint-plugin-promise": "^4.2.1",
      "eslint-plugin-standard": "^4.0.0",
      "eslint-plugin-vue": "^6.2.2",
      "html-webpack-plugin": "^4.0.4",
      "http-proxy-middleware": "^2.0.0",
      "husky": "^1.1.1",
      "lint-staged": "^9.5.0",
      "mini-css-extract-plugin": "^0.9.0",
      "node-sass": "4.14.1",
      "runjs": "^4.4.2",
      "sass": "^1.35.1",
      "sass-loader": "8.0.2",
      "style-resources-loader": "^1.4.1",
      "vue-cli-plugin-style-resources-loader": "^0.1.5",
      "vue-template-compiler": "^2.6.11"
    },
    commitlint: {
      "extends": [
        "@commitlint/config-conventional"
      ]
    },
    "lint-staged": {
      "*.{js,jsx,vue}": [
        "vue-cli-service lint",
        "git add"
      ]
    }
  })

  // 复制并用 ejs 渲染 `./template` 内所有的文件
  api.render('../template')
}